{include file="public/nheader"}
<style type="text/css">
    #lay-tableList {
        height: auto;
    }
</style>
<table id="lay-tableList" lay-filter="lay-tableList"></table>

<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">
                    <form class="layui-form layui-form-pane form-search">
                        <div class="layui-inline">
                            <div class="layui-input-inline ">
                                <input value="{:input('title/s')}" name="title" class="layui-input" type="text" placeholder="账号" />
                            </div>
                        </div>
                        <div class="layui-inline">
                            <!-- // 默认搜索 -->
                            <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit>搜索</button>
                            <a class="layui-btn icon-btn" lay-maxmin="true" lay-open="" data-title="添加"
                                data-area="60%,80%" data-url="/store/user_edit" data-reload="parnet" >添加用户
                        </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <!-- // 创建数据实例 -->
        <!-- // 创建数据实例 -->
        <div class="layui-fluid layadmin-cmdlist-fluid">
            <div class="caller-contar" id="LAY_demo1">
                <!-- <div class="layui-col-md2 layui-col-sm4 layui-fluid "
                    style="background-color: #d6e6f5;border-bottom:1px solid #fff;border-right:1px solid #fff;">
                    <div class="caller-main caller-fl">
                        <p>用户名:邹鹏飞</p>
                        <p>手机号:15897381680</p>
                        <p>可用余额:0</p>
                    </div>
                    <div>
                        <button class="layui-btn icon-btn layui-btn-orange layui-btn-sm" lay-open data-title="明细"
                            data-area="60%,80%" data-url="/store/moneylog?user_id={{d.id}}">消费明细</button>
                        <button class="layui-btn icon-btn layui-btn-warm layui-btn-sm" lay-open data-title="资产变更"
                            data-area="60%,80%" data-url="/store/money_edit?id=1">修改资产</button>
                    </div>
                </div> -->
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</div>
{include file="public/nfooter"}
<script>
    layui.use('flow', function () {
        var flow = layui.flow;
        flow.load({
            elem: '#LAY_demo1' //流加载容器
            , done: function (page, next) {
                //执行下一页的回调
                console.log(page);
                console.log(next);
                $.ajax({
                    url: "{:url()}",
                    type: 'post',
                    data: { "page": page,'title':"{:input('title/s')}"},
                    success: function (res) {
                        if (res.code == 200) {
                            var lis = [];
                            //假设你的列表返回在data集合中
                            layui.each(res.data, function (index, value) {
                                var str = '<div class="layui-col-md12 layui-col-sm4 layui-fluid "style="background-color: #d6e6f5;border-bottom:1px solid #fff;border-right:1px solid #fff;"><div class="caller-main caller-fl"><p>用户名:' + value.name + '</p><p>手机号:' + value.mobile + '</p><p>可用余额:' + value.money + '</p></div><div><button class="layui-btn icon-btn layui-btn-orange layui-btn-sm"lay-open data-title="明细"data-area="60%,80%" data-url="/store/moneylog?user_id=' + value.id + '">消费明细</button><button class="layui-btn icon-btn layui-btn-warm layui-btn-sm"lay-open data-title="资产变更"data-area="60%,80%"data-url="/store/money_edit?id=' + value.id + '">修改资产</button></div></div>';
                                lis.push(str);
                            });
                            //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
                            next(lis.join(''), page < res.data.length);
                        }
                    }
                });
            }
        });
    });
</script>